package com.icebartech.base.modules.common.facade.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.icebartech.base.modules.common.facade.AttachmentInfoFacade;
import com.icebartech.base.modules.common.service.AttachmentInfoService;
import com.icebartech.core.enums.CommonResultCodeEnum;
import com.icebartech.core.vo.FileInfo;
import com.icebartech.core.vo.ResponseData;

@Service
public class AttachmentInfoFacadeImpl implements AttachmentInfoFacade {

	@Autowired
	private AttachmentInfoService attachmentInfoService;

	@Override
	public ResponseData<FileInfo> findAttachmentFile(String fileId) {
		ResponseData<FileInfo> resp = ResponseData.builder(null, CommonResultCodeEnum.FAIL);
		FileInfo fileInfo = attachmentInfoService.findAttachmentFile(fileId);
		resp = ResponseData.builder(fileInfo, CommonResultCodeEnum.SUCCESS);
		return resp;
	}

}
